package models

import "tuowei.com/common/models"

type SysExerciseRecord struct {
	models.Model
	StudentId      int    `json:"student_id" gorm:"int(10);not null;comment:学生ID"`
	PracticeId     int    `json:"practice_id" gorm:"int(10);default:0;comment:练习题记录ID"`
	LinkId         int    `json:"link_id" gorm:"int(10);not null;comment:关联ID"`
	ChapterId      int    `json:"chapter_id" gorm:"int(10);comment:章节ID"`
	ExId           int    `json:"ex_id" gorm:"int(10);not null;comment:练习题ID"`
	SubjectType    string `json:"subject_type" gorm:"varchar(20);comment:题型 1=单选题/2=多选题/3=判断题/4=应用题"`
	ExerciseType   int    `json:"ex_type" gorm:"tinyint(1);not null;column:ex_type;comment:练习题类型 1=课程练习题 2=题库练习题 3=试卷练习题"`
	Status         int    `json:"status" gorm:"tinyint(1);comment:1为正确，0为错误"`
	SelectedAnswer string `json:"selected_answer" gorm:"varchar(50);comment:提交答案"`
	Nums           int    `json:"nums" gorm:"int(10);comment:做过的次数"`
}

func (SysExerciseRecord) TableName() string {
	return "sys_exercise_record"
}

type ExerciseRecordList struct {
	ExId          int    `json:"ex_id"`
	SubjectType   string `json:"subject_type" gorm:"type:varchar(20);comment:题目类型"`
	Content       string `json:"content" gorm:"type:text;comment:题目内容"`
	CorrectAnswer string `json:"correct_answer" gorm:"type:text;comment:正确答案"`
	Analysis      string `json:"analysis" gorm:"type:text;comment:题目解析"`
	//LinkId        int    `json:"link_id" gorm:"-"`
	//LinkTitle     string `json:"link_title" comment:"错误记录标题" gorm:"-"`
	Status         int    `json:"status" gorm:"tinyint(1);comment:1为正确，0为错误"`
	SelectedAnswer string `json:"selected_answer" gorm:"varchar(50);comment:提交答案"`
	Answer         string `json:"answer" comment:"提供选择的答案"`
	Name           string `json:"name"`
}

func (ExerciseRecordList) TableName() string {
	return "sys_exercise_record"
}
